﻿@{
    ViewData["Title"] = "Edit";
    
     Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>layui在线调试</title>
    <link href="~/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
    <form class="layui-form" action="/Cost/UpdateFieId" lay-filter="example">
  <div class="layui-form-item">
    <label class="layui-form-label">车牌号：</label>
    <div class="layui-input-block">
      <input type="text" id="VehicleId" name="VehicleId" lay-verify="required" placeholder="请输入车牌号" autocomplete="off" class="layui-input" style="width:40%">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">加油费用</label>
    <div class="layui-input-block" style="width:50%">
       <input type="text" id="CostPrice" name="CostPrice" lay-verify="required" placeholder="请输入加油费用" autocomplete="off" class="layui-input" style="width:40%">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">加油量:</label>
    <div class="layui-input-block">
      <input type="text" id="Cmass" name="Cmass" lay-verify="required" placeholder="请输入加油量" autocomplete="off" class="layui-input" style="width:40%">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">起始公里数：</label>
    <div class="layui-input-block" style="width:50%">
          <input type="text" id="Cpassenger" name="Cpassenger" lay-verify="required" placeholder="请输入加油量" autocomplete="off" class="layui-input" style="width:40%">

    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">支付方式:</label>
    <div class="layui-input-block">
         <select id="Cway" name="Cway" lay-verify="required">
        <option value=""></option>
        <option value="微信支付">微信支付</option>
        <option value="支付宝支付">支付宝支付</option>
        <option value="银联支付">银联支付</option>
        <option value="企业转账">企业转账</option>
        <option value="线下支付">线下支付</option>
        <option value="其他">其他</option>
      </select>
 
    </div>
    </div>
    <div class="layui-form-item">
    <label class="layui-form-label">经办人：</label>
    <div class="layui-input-block" style="width:50%">
           <input type="text" id="Cresponsible" name="Cresponsible" lay-verify="required" placeholder="请输入经办人" autocomplete="off" class="layui-input" style="width:40%">

    </div>
  </div>
    <div class="layui-form-item">
    <label class="layui-form-label">备注:</label>
    <div class="layui-input-block">
      <input type="text" id="Cremark" name="Cremark" lay-verify="required" placeholder="请输入备注" autocomplete="off" class="layui-input" style="width:40%">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
        <input name="Id" type="text" hidden/>
      <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
     <a class="layui-btn layui-btn-primary" onclick="location.href='/Cost/Index'">返回</a>
    </div>
  </div>
</form>
    <script src="~/libs/jquery/jquery.js"></script>
    <script src="~/layui/layui.js" charset="utf-8"></script>

    <script>
        layui.use(['form', 'layedit', 'laydate','upload'], function(){
          var form = layui.form
          ,layer = layui.layer
          ,layedit = layui.layedit
          ,laydate = layui.laydate
          ,upload = layui.upload
          ,element = layui.element;

          //日期
          laydate.render({
            elem: '#SigningDate'
          });
          form.render();
          //监听提交
          form.on('submit(demo1)', function(data){
          });
          //指定允许上传的文件类型
          //upload.render({
          //  elem: '#test3'
          //  ,url: '/CarryContract/FileUpload' //此处配置你自己的上传接口即可
          //  ,accept: 'file' //普通文件
          //  ,done: function(res){
          //    layer.msg('上传成功');
          //    console.log(res);
          //  }
          //});
          
        });
        $(function(){
            Edit();
        })
        function Edit(){
            $.ajax({
                url:"/Cost/GetCarryById?Id="+@ViewBag.Id,
                type:"get",
                dataType:"json",
                success:function(obj){
                    $("[name=Id]").val(obj.id);
                    $("[name=VehicleId]").val(obj.vehicleId);
                    $("[name=CostPrice]").val(obj.costPrice);
                    $("[name=Cmass]").val(obj.cmass);
                    $("[name=Cpassenger]").val(obj.cpassenger);
                    $("[name=Cway]").val(obj.cway);
                    $("[name=Cresponsible]").val(obj.cresponsible);
                    $("[name=Cremark]").val(obj.cremark);
                    $("[name=Cdate]").val(obj.cdate);
                    //console.log($("[name=Id]").val());
                }
            })
        }
    </script>
</body>
</html>



